/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CONTROL;

import MODEL.dangnhap_Model;
import UTILITY.KetNoiDuLieu;
import java.sql.ResultSet;

/**
 *
 * @author CONGTHANH
 */
public class DangNhap_Control {
     public static dangnhap_Model dangnhap(String sql){
        dangnhap_Model n=new dangnhap_Model();
        try{
            KetNoiDuLieu hp=new KetNoiDuLieu();
          //  Statement st=hp.getStatement();
            hp.open();
            ResultSet rs=hp.executeQuery(sql);
            while(rs.next()){
               // n.setId(rs.getString(1));
              //  n.setTendn(rs.getString(2));
               // n.setMatkhau(rs.getString(3));
                n.setTen_hienthi(rs.getString(1));
                n.setQuyen(rs.getString(2));
               // n.setMotaquyen(rs.getString(6));
            }
            hp.close();
        }catch(Exception ex){
            System.out.println(ex.getMessage());
        }
        return n;
    }
    
}
